package com.heima.article.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.heima.model.article.dtos.ArticleHomeDto;
import com.heima.model.article.pojos.ApArticle;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
@Repository
public interface ApArticleMapper extends BaseMapper<ApArticle> {
     /**
      *
      * @param dto
      * @param loadType 1代表小于minBehottime 2代表大于maxBehotTime
      * @return
      */
     List<ApArticle> loadArticle(@Param("dto") ArticleHomeDto dto, @Param("loadType") Integer loadType);

     List<ApArticle> findArticleByLast5Days(@Param("last5Day") LocalDateTime last5Day);
}